//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<IBitmap.h>
///	@path	~/src/gui/image/
///	@date	2008/06/24
///	@desc	.

#pragma once

#include "xeres.h"

#include "lib/math/color.h"
#include "lib/math/pair.h"

#include "object/IObject.h"

namespace xeres {

	/*! 
		\class	IBitmap
		\brief
	*/
	class IBitmap : public IObject
	{
	public:

		/// \ctor
		IBitmap( void );

		/// \dtor
		virtual ~IBitmap( void );

		DECL_IOBJECT_INTERFACE( IBitmap , IObject );

	public:

		/// \name	Bitmap Interface
		//@{

		/// \brief	Get width of bitmap.
		virtual size_t GetWidth( void ) = 0;

		/// \brief	Get height of bitmap.
		virtual size_t GetHeight( void ) = 0;

		/// \brief	Get size of bitmap.
		virtual Pair<int> GetSize( void ) = 0;

		/// \brief	Get frame count.
		virtual int GetFrame( void ) = 0;

		/// \brief	Get frame delay.
		virtual float GetDelay( int frame ) = 0;

		/// \brief	Get storage size.
		virtual size_t GetStorageSize( void ) = 0;

		/// \brief	Get color type of bitmap (only COLOR_MONO , COLOR_RGB , COLOR_RGBA & COLOR_ARGB is valid ).
		virtual ColorType GetColorType( void ) = 0;

		/// \brief	Get pixel of bitmap.
		virtual RGBA GetPixel( const Pair<int>& point , int frame = 0 ) = 0;

		/// \brief	Sampler for bitmap composition.
		struct Sampler
		{
			const byte *	m_bits;
			ColorType		m_type;
			size_t			m_pitch;
		};
		
		/// \brief	Get sampler.
		virtual void GetSampler( const Pair<int>& point , Sampler& sampler , int frame = 0 ) = 0;

		//@}
	};

} // namespace xeres
